package hello.configuration.filter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description:
 * @Author: m01
 * @Date: created at  2018/12/20  14:50
 * @Modified By:
 */



@Configuration
public class SelfFilterConfig {

    /*private static final Logger logger = LoggerFactory.getLogger(SelfFilterConfig.class);
    @Bean
    public FilterRegistrationBean unauthorizedaccessFilter() {
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(new AuthenticationFilter());
        bean.addUrlPatterns("/api/*");
        bean.setOrder(1);
        return bean;
    }*/

    @Bean
    public FilterRegistrationBean unauthorizedaccessFilter() {
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(new CharacterFilter());
        bean.addUrlPatterns("/api/*");
        bean.setOrder(1);
        return bean;
    }


}